import React, { useMemo } from 'react';
import './App.css';
import { routes } from "./router"
import { Routes, Route,  useNavigate } from "react-router-dom";
import withRouter from './utils/withRouter';
function App(props: any) {
  const navigate = useNavigate()
  
  return (
    <div>
      <Routes>
        {
          routes.map(item => (
            <Route
              key={item.path}
              path={item.path}
              element={<item.element navigate={navigate}></item.element>}
            ></Route>
          ))
        }
      </Routes>
      
    </div>
  );
}

export default withRouter(App);
